package com.msconfig.mvp.view.fragment;

/*
 * author: caojunhao
 * date  : 2020/4/28
 * desc  :
 */

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.geo.msconfig.R;
import com.msconfig.event.NullEvent;
import com.msconfig.mvp.view.activity.base.BaseMvpFragment;
import com.msconfig.mvp.view.activity.base.BasePresenter;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import java.util.List;

public class OtherPageFragment extends BaseMvpFragment implements View.OnClickListener{

    private LinearLayout llOtherLog;
    private LinearLayout llOtherResult;
    public static OtherPageFragment newInstance() {
        Bundle args = new Bundle();
        OtherPageFragment fragment = new OtherPageFragment();
        fragment.setArguments(args);
        return fragment;
    }
    @Override
    protected int getLayoutId() {
        return R.layout.layout_fragment_other;
    }

    @Override
    protected void initView(View view) {
        llOtherLog=view.findViewById(R.id.ll_other_log);
        llOtherResult=view.findViewById(R.id.ll_other_result);
    }

    @Override
    protected void initListener(View view) {
        llOtherLog.setOnClickListener(this);
        llOtherResult.setOnClickListener(this);
    }

    @Override
    protected void initData() {

    }

    //目前这里只是为了实现eventbus
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void haveNull(NullEvent event) {
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ll_other_log:
                Toast.makeText(getContext(),R.string.toast_soon, Toast.LENGTH_SHORT).show();
                //((BaseMvpActivity) getActivity()).goToNextFragment(this, OtherLogFragment.newInstance());
                break;
            case R.id.ll_other_result:
                Toast.makeText(getContext(),R.string.toast_soon, Toast.LENGTH_SHORT).show();
                //((BaseMvpActivity) getActivity()).goToNextFragment(this, OtherResultFragment.newInstance());
                break;
        }
    }

    @Override
    protected void createPresenter(List<BasePresenter> mPresenters) {

    }

}
